Release 10.1A: OpenEdge Development:
Progress Dynamics Basic Development


Relative positioning in the containers

The Progress Dynamics framework supports the creation of dynamic container windows, where many or all objects in the container can be realized at run time from data in the Object Repository. In principle, these windows are always resizable, and the objects inside them resize appropriately. The framework also supports the notion of a tab folder with multiple pages within a single window. In such a container, the tab folder visualization itself is considered to be on Page 0, meaning that it is always displayed. Other objects can also be on Page 0, for example, a toolbar to be used by objects on the different pages of the folder, or perhaps a browser or viewer above the folder to display summary information you always want to have visible. You can then define other pages starting at Page 1, with the page numbers corresponding to the order of the tabs on the folder. You can place one or more objects on each page, and the user can view them when selecting that tab. In the Container Builder, you can define a layout for a window with no pages, for Page 0 of a tab folder window, or for a Page Layout to be displayed on a page of a tab folder. You can then assemble the pages flexibly to create a particular application window.

Progress Dynamics defines several different layout types for dynamic, resizable layouts. Previously, some of these layouts had names such as “Top/Multi/Bottom,” meaning (for example) that the container type supports an object in a top section of the window, one or more objects (on top of one another) in a central section, and an object in a bottom section. However, there is now a single, very flexible dynamic layout called “Relative,” which is used by the Container Builder. This layout type is generally the only one you need for new dynamic containers.

The Relative layout type supports a main section that starts at the top of the window or the page. Within this section, you can place up to nine rows of up to nine objects. In addition, you can also use a separate bottom section with a single row of up to nine objects. The bottom section, if it exists, is always bottom-justified in the window or page. That is, if you resize the window such that there is extra space at the lower end of the main section of the window, then the objects in the bottom section move down to the bottom of the window, leaving empty space above them.

Each object in a window has a layout position represented by a three-character code. The first character is “M” or “B” depending on whether this object is in the main or bottom section. The second character is a digit representing the row, and the third character is a digit representing the left-to-right position or sequence within that row.

Note: Row in this case does not mean the actual coordinate of the object, as in a row/column designation, but simply the relative position of the object from top to bottom.

The third character can also be a “C,” meaning that the object is centered within the row (or within the remaining available space in the row) or “R,” meaning that the object is right-justified within the row. SmartDataObjects and other nonvisual objects are automatically assigned to row 0, since they do not actually appear in any way at run time.

For example, a window or page with a toolbar at the top, and an SDO, followed by a browser, under that a viewer, and another toolbar at the bottom, would assign to those objects the layout positions “M11” for the toolbar, “M01” for the SDO, “M21” for the browser, “M31” for the viewer, and “B11” for the bottom toolbar.

If you want the viewer to be to the right of the browser rather than underneath it, change its position to “M22.” The Container Builder assists you in assigning these positions to objects in the layout template. The objects in an actual window you build from that template are placed in the same relative positions.

Each object, depending on its object type, can be resizable in the horizontal dimension, in the vertical dimension, or both. For example, a browser is normally resizable both horizontally and vertically (though it, like all visual objects, has the properties resizeHorizontal and resizeVertical where this can be set differently for a specific object). A viewer is normally not resizable at all. A toolbar is normally resizable horizontally but not vertically. All objects also have an initial size, which has a default value for each object type. This means that when a window is initially instantiated for a user, the Layout Manager determines the minimum size for the window based on the initial size of each object inside it. The window initially displays with the minimum size. If you resize the window by dragging one of its corners or edges, the Layout Manager recalculates the size of each of its contained objects. A toolbar stretches horizontally but not vertically. A browser stretches in both dimensions unless its properties are set otherwise. A viewer remains the same size.

If there are resizable and fixed-height objects in the same row, the resizable objects stretch vertically to match the height of the tallest fixed-height object in the row. If the resizable object is initially already taller than the fixed-size object, it remains fixed at its original height. If there are multiple horizontally resizable objects in a row, they share equally the available space after fixed-width objects are accounted for. For tab folder pages, the Layout Manager uses the available space within the tab folder to allocate each of the pages. The size of the tab folder itself, its toolbars if there are any, and any other objects that have been placed on Page 0 are taken into account before allocating other pages within the tab folder. Because Progress Dynamics creates the objects on each page of a folder only when that page is first selected, it might automatically resize a tab folder the first time a user selects its pages.

All this is handled automatically and lets you make effective use of screen space. As a standard feature, the latest size and position of each window are saved as a user preference.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095